home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / QuickdrawText.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  10.9 KB  |  396 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QuickdrawText.a
  3. ;
  4. ;    Contains:    Quickdraw Text Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1983-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QUICKDRAWTEXT__') = 'UNDEFINED' THEN
  19. __QUICKDRAWTEXT__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.  
  28.  
  29.                                                             ; CharToPixel directions 
  30. leftCaret                        EQU        0                    ;Place caret for left block
  31. rightCaret                        EQU        -1                    ;Place caret for right block
  32. kHilite                            EQU        1                    ;Direction is SysDirection
  33. smLeftCaret                        EQU        0                    ;Place caret for left block - obsolete 
  34. smRightCaret                    EQU        -1                    ;Place caret for right block - obsolete 
  35. smHilite                        EQU        1                    ;Direction is TESysJust - obsolete 
  36.  
  37.                                                             ;Constants for styleRunPosition argument in PortionLine, DrawJustified, MeasureJustified, CharToPixel, and PixelToChar.
  38. onlyStyleRun                    EQU        0                    ; This is the only style run on the line 
  39. leftStyleRun                    EQU        1                    ; This is leftmost of multiple style runs on the line 
  40. rightStyleRun                    EQU        2                    ; This is rightmost of multiple style runs on the line 
  41. middleStyleRun                    EQU        3                    ; There are multiple style runs on the line and this is neither the leftmost nor the rightmost. 
  42. smOnlyStyleRun                    EQU        0                    ; obsolete 
  43. smLeftStyleRun                    EQU        1                    ; obsolete 
  44. smRightStyleRun                    EQU        2                    ; obsolete 
  45. smMiddleStyleRun                EQU        3                    ; obsolete 
  46. ;  type for styleRunPosition parameter in PixelToChar etc. 
  47. ; typedef short                         JustStyleCode
  48.  
  49. FontInfo                RECORD 0
  50. ascent                     ds.w    1                ; offset: $0 (0)
  51. descent                     ds.w    1                ; offset: $2 (2)
  52. widMax                     ds.w    1                ; offset: $4 (4)
  53. leading                     ds.w    1                ; offset: $6 (6)
  54. sizeof                     EQU *                    ; size:   $8 (8)
  55.                         ENDR
  56. FormatOrder                RECORD 0
  57. elements                 ds.w    1
  58. sizeof                     EQU *                    ; size:   $2 (2)
  59.                         ENDR
  60.  
  61.  
  62. ; typedef FormatOrder *                    FormatOrderPtr
  63.  
  64. ;  FormatStatus was moved to TextUtils.i 
  65. OffPair                    RECORD 0
  66. offFirst                 ds.w    1                ; offset: $0 (0)
  67. offSecond                 ds.w    1                ; offset: $2 (2)
  68. sizeof                     EQU *                    ; size:   $4 (4)
  69.                         ENDR
  70. OffsetTable                RECORD 0
  71. elements                 ds.b    3 * OffPair.sizeof
  72. sizeof                     EQU *                    ; size:   $C (12)
  73.                         ENDR
  74.  
  75.  
  76. ;
  77. ; pascal short Pixel2Char(Ptr textBuf, short textLen, short slop, short pixelWidth, Boolean *leadingEdge)
  78. ;
  79.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  80.         Macro
  81.         _Pixel2Char
  82.             move.l              #$820E0014,-(sp)
  83.             dc.w                $A8B5
  84.         EndM
  85.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  86.         IMPORT_CFM_FUNCTION Pixel2Char
  87.     ENDIF
  88.  
  89. ;
  90. ; pascal short Char2Pixel(Ptr textBuf, short textLen, short slop, short offset, short direction)
  91. ;
  92.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  93.         Macro
  94.         _Char2Pixel
  95.             move.l              #$820C0016,-(sp)
  96.             dc.w                $A8B5
  97.         EndM
  98.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  99.         IMPORT_CFM_FUNCTION Char2Pixel
  100.     ENDIF
  101.  
  102. ;
  103. ; pascal short PixelToChar(Ptr textBuf, long textLength, Fixed slop, Fixed pixelWidth, Boolean *leadingEdge, Fixed *widthRemaining, JustStyleCode styleRunPosition, Point numer, Point denom)
  104. ;
  105.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  106.         Macro
  107.         _PixelToChar
  108.             move.l              #$8222002E,-(sp)
  109.             dc.w                $A8B5
  110.         EndM
  111.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  112.         IMPORT_CFM_FUNCTION PixelToChar
  113.     ENDIF
  114.  
  115. ;
  116. ; pascal short CharToPixel(Ptr textBuf, long textLength, Fixed slop, long offset, short direction, JustStyleCode styleRunPosition, Point numer, Point denom)
  117. ;
  118.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  119.         Macro
  120.         _CharToPixel
  121.             move.l              #$821C0030,-(sp)
  122.             dc.w                $A8B5
  123.         EndM
  124.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  125.         IMPORT_CFM_FUNCTION CharToPixel
  126.     ENDIF
  127.  
  128. ;
  129. ; pascal void DrawJustified(Ptr textPtr, long textLength, Fixed slop, JustStyleCode styleRunPosition, Point numer, Point denom)
  130. ;
  131.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  132.         Macro
  133.         _DrawJustified
  134.             move.l              #$80160032,-(sp)
  135.             dc.w                $A8B5
  136.         EndM
  137.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  138.         IMPORT_CFM_FUNCTION DrawJustified
  139.     ENDIF
  140.  
  141. ;
  142. ; pascal void MeasureJustified(Ptr textPtr, long textLength, Fixed slop, Ptr charLocs, JustStyleCode styleRunPosition, Point numer, Point denom)
  143. ;
  144.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  145.         Macro
  146.         _MeasureJustified
  147.             move.l              #$801A0034,-(sp)
  148.             dc.w                $A8B5
  149.         EndM
  150.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  151.         IMPORT_CFM_FUNCTION MeasureJustified
  152.     ENDIF
  153.  
  154. ;
  155. ; pascal Fixed PortionLine(Ptr textPtr, long textLen, JustStyleCode styleRunPosition, Point numer, Point denom)
  156. ;
  157.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  158.         Macro
  159.         _PortionLine
  160.             move.l              #$84120036,-(sp)
  161.             dc.w                $A8B5
  162.         EndM
  163.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  164.         IMPORT_CFM_FUNCTION PortionLine
  165.     ENDIF
  166.  
  167. ;
  168. ; pascal void HiliteText(Ptr textPtr, short textLength, short firstOffset, short secondOffset, OffsetTable offsets)
  169. ;
  170.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  171.         Macro
  172.         _HiliteText
  173.             move.l              #$800E001C,-(sp)
  174.             dc.w                $A8B5
  175.         EndM
  176.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  177.         IMPORT_CFM_FUNCTION HiliteText
  178.     ENDIF
  179.  
  180. ;
  181. ; pascal void DrawJust(Ptr textPtr, short textLength, short slop)
  182. ;
  183.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  184.         Macro
  185.         _DrawJust
  186.             move.l              #$8008001E,-(sp)
  187.             dc.w                $A8B5
  188.         EndM
  189.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  190.         IMPORT_CFM_FUNCTION DrawJust
  191.     ENDIF
  192.  
  193. ;
  194. ; pascal void MeasureJust(Ptr textPtr, short textLength, short slop, Ptr charLocs)
  195. ;
  196.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  197.         Macro
  198.         _MeasureJust
  199.             move.l              #$800C0020,-(sp)
  200.             dc.w                $A8B5
  201.         EndM
  202.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  203.         IMPORT_CFM_FUNCTION MeasureJust
  204.     ENDIF
  205.  
  206. ;
  207. ; pascal Fixed PortionText(Ptr textPtr, long textLength)
  208. ;
  209.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  210.         Macro
  211.         _PortionText
  212.             move.l              #$84080024,-(sp)
  213.             dc.w                $A8B5
  214.         EndM
  215.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  216.         IMPORT_CFM_FUNCTION PortionText
  217.     ENDIF
  218.  
  219. ;
  220. ; pascal long VisibleLength(Ptr textPtr, long textLength)
  221. ;
  222.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  223.         Macro
  224.         _VisibleLength
  225.             move.l              #$84080028,-(sp)
  226.             dc.w                $A8B5
  227.         EndM
  228.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  229.         IMPORT_CFM_FUNCTION VisibleLength
  230.     ENDIF
  231.  
  232. ;
  233. ; pascal void GetFormatOrder(FormatOrderPtr ordering, short firstFormat, short lastFormat, Boolean lineRight, StyleRunDirectionUPP rlDirProc, Ptr dirParam)
  234. ;
  235.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  236.         Macro
  237.         _GetFormatOrder
  238.             move.l              #$8012FFFC,-(sp)
  239.             dc.w                $A8B5
  240.         EndM
  241.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION GetFormatOrder
  243.     ENDIF
  244.  
  245.  
  246.  
  247. ;
  248. ; pascal void TextFont(short font)
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  251.         _TextFont:    OPWORD    $A887
  252.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  253.         IMPORT_CFM_FUNCTION TextFont
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal void TextFace(StyleParameter face)
  258. ;
  259.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  260.         _TextFace:    OPWORD    $A888
  261.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  262.         IMPORT_CFM_FUNCTION TextFace
  263.     ENDIF
  264.  
  265. ;
  266. ; pascal void TextMode(short mode)
  267. ;
  268.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  269.         _TextMode:    OPWORD    $A889
  270.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  271.         IMPORT_CFM_FUNCTION TextMode
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal void TextSize(short size)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  278.         _TextSize:    OPWORD    $A88A
  279.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  280.         IMPORT_CFM_FUNCTION TextSize
  281.     ENDIF
  282.  
  283. ;
  284. ; pascal void SpaceExtra(Fixed extra)
  285. ;
  286.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  287.         _SpaceExtra:    OPWORD    $A88E
  288.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  289.         IMPORT_CFM_FUNCTION SpaceExtra
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal void DrawChar(CharParameter ch)
  294. ;
  295.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  296.         _DrawChar:    OPWORD    $A883
  297.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION DrawChar
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal void DrawString(ConstStr255Param s)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  305.         _DrawString:    OPWORD    $A884
  306.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  307.         IMPORT_CFM_FUNCTION DrawString
  308.     ENDIF
  309.  
  310. ;
  311. ; pascal void DrawText(const void *textBuf, short firstByte, short byteCount)
  312. ;
  313.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  314.         _DrawText:    OPWORD    $A885
  315.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  316.         IMPORT_CFM_FUNCTION DrawText
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal short CharWidth(CharParameter ch)
  321. ;
  322.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  323.         _CharWidth:    OPWORD    $A88D
  324.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  325.         IMPORT_CFM_FUNCTION CharWidth
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal short StringWidth(ConstStr255Param s)
  330. ;
  331.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  332.         _StringWidth:    OPWORD    $A88C
  333.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  334.         IMPORT_CFM_FUNCTION StringWidth
  335.     ENDIF
  336.  
  337. ;
  338. ; pascal short TextWidth(const void *textBuf, short firstByte, short byteCount)
  339. ;
  340.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  341.         _TextWidth:    OPWORD    $A886
  342.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  343.         IMPORT_CFM_FUNCTION TextWidth
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal void MeasureText(short count, const void *textAddr, void *charLocs)
  348. ;
  349.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  350.         _MeasureText:    OPWORD    $A837
  351.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  352.         IMPORT_CFM_FUNCTION MeasureText
  353.     ENDIF
  354.  
  355. ;
  356. ; pascal void GetFontInfo(FontInfo *info)
  357. ;
  358.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  359.         _GetFontInfo:    OPWORD    $A88B
  360.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  361.         IMPORT_CFM_FUNCTION GetFontInfo
  362.     ENDIF
  363.  
  364. ;
  365. ; pascal void CharExtra(Fixed extra)
  366. ;
  367.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  368.         _CharExtra:    OPWORD    $AA23
  369.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  370.         IMPORT_CFM_FUNCTION CharExtra
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal void StdText(short count, const void *textAddr, Point numer, Point denom)
  375. ;
  376.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  377.         _StdText:    OPWORD    $A882
  378.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  379.         IMPORT_CFM_FUNCTION StdText
  380.     ENDIF
  381.  
  382. ;
  383. ; pascal short StdTxMeas(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info)
  384. ;
  385.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  386.         _StdTxMeas:    OPWORD    $A8ED
  387.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  388.         IMPORT_CFM_FUNCTION StdTxMeas
  389.     ENDIF
  390.  
  391.  
  392.     IF OLDROUTINENAMES THEN
  393.     ENDIF    ; OLDROUTINENAMES
  394.     ENDIF ; __QUICKDRAWTEXT__ 
  395.  
  396.